package com.example.okhttptest;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import org.greenrobot.eventbus.EventBus;

public class CommonActivity extends AppCompatActivity implements View.OnClickListener {

    Button send;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_common);
        send = findViewById(R.id.send);
        send.setOnClickListener(this);


    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.send:
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        EventBus.getDefault().post(123456);
                        finish();
                    }
                }).start();
                break;
        }
    }
}
